import service from '../../utils/request'

//区域管理
//新增用户
export function addUser(payload = {}) {
    return service({
        url: '/area/add',
        method: 'POST',
        data: payload
    })
}
//修改状态
export function changeStatus(areaId: any, status: any) {
    return service({
        url: `/area/updateStatus/${areaId}/${status}`,
        method: 'put',
    })
}
//分页查询
export function queryAll(payload = {}) {
    return service({
        url: '/area/queryAll',
        method: 'GET',
        params: payload
    })
}
//根据关键字查询
export function data_queryKey(key: any) {
    return service({
        url: '/area/queryKey',
        method: 'GET',
        params: {
            key
        }
    })
}
//根据id进行查询
export function data_querySingle(areaId:any) {
    return service({
        url: '/area/querySingle',
        method: 'get',
        params: {
            areaId
        }
    })
}
//根据状态进行查询
export function data_queryStatus(status: number) {
    return service({
        url: '/area/queryStatus',
        method: 'GET',
        params: {
            status
        }
    })
}
//编辑
export function data_update(payload = {}) {
    return service({
        url: '/area/update',
        method: 'PUT',
        data: payload
    })
}
//删除数据
export function data_delete(areaId: any) {
    return service({
        url: `/area/delete/${areaId}`,
        method: 'DELETE',
        data: {
            areaId
        }
    })
}

//品类管理
//分页查询
export function data_category_queryAll(payload = {}) {
    return service({
        url: '/category/queryAll',
        method: 'GET',
        params: payload
    })
}
//新增品类
export function data_category_add(payload = {}) {
    return service({
        url: '/category/add',
        method: 'POST',
        data: payload
    })
}
//编辑内容
export function data_category_update(payload = {}) {
    return service({
        url: '/category/update',
        method: 'PUT',
        data: payload
    })
}
//修改状态
export function data_category_updateStatus(categoryId: any, categoryStatus: any) {
    return service({
        url: `/category/updateStatus/${categoryId}/${categoryStatus}`,
        method: 'PUT',
    })
}
//根据状态进行查询
export function data_category_queryStatus(payload: any) {
    return service({
        url: '/category/queryStatus',
        method: 'GET',
        params: payload
    })
}
//根据关键字查询
export function data_category_queryKey(key: any) {
    return service({
        url: '/category/queryKey',
        method: 'GET',
        params: {
            key
        }
    })
}
//根据id进行查询
export function data_category_querySingle(payload = {}) {
    return service({
        url: '/category/querySingle',
        method: 'GET',
        params: payload
    })
}
//删除数据
export function data_category_delete(categoryId: any) {
    return service({
        url: `/category/delete/${categoryId}`,
        method: 'DELETE',
    })
}



//物料分类
//新增物料信息
export function data_materiel_add(payload = {}) {
    return service({
        url: '/materiel/add',
        method: 'POST',
        data: payload
    })
}
//分页查询
export function data_materiel_queryAll(payload = {}) {
    return service({
        url: '/materiel/queryAll',
        method: 'GET',
        params: payload
    })
}
//编辑内容
export function data_materiel_update(payload = {}) {
    return service({
        url: '/materiel/update',
        method: 'PUT',
        data: payload
    })
}
//修改状态
export function data_materiel_updateStatus(materielId: any, materielStatus: any) {
    return service({
        url: `/materiel/updateStatus/${materielId}/${materielStatus}`,
        method: 'PUT',
    })
}
//根据状态进行查询
export function data_materiel_queryStatus(payload: any) {
    return service({
        url: '/materiel/queryStatus',
        method: 'GET',
        params: payload
    })
}
//根据关键字查询
export function data_materiel_queryKey(key: any) {
    return service({
        url: '/materiel/queryKey',
        method: 'GET',
        params: {
            key
        }
    })
}
//删除数据
export function data_materiel_delete(materielId: any) {
    return service({
        url: `/materiel/delete/${materielId}`,
        method: 'DELETE',
        data: {
            materielId
        }
    })
}
//根据id进行查询
export function data_materiel_querySingle(payload = {}) {
    return service({
        url: '/materiel/querySingle',
        method: 'GET',
        params: payload
    })
}


//产品线管理
//新增产品线信息
export function data_productLine_add(payload = {}) {
    return service({
        url: '/productLine/add',
        method: 'POST',
        data: payload
    })
}
//分页查询
export function data_productLine_queryAll(payload = {}) {
    return service({
        url: '/productLine/queryAll',
        method: 'GET',
        params: payload
    })
}
//编辑内容
export function data_productLine_update(payload = {}) {
    return service({
        url: '/productLine/update',
        method: 'PUT',
        data: payload
    })
}
//修改状态
export function data_productLine_updateStatus(productLineId: any, productLineStatus: any) {
    return service({
        url: `/productLine/updateStatus/${productLineId}/${productLineStatus}`,
        method: 'PUT',
    })
}
//根据状态进行查询
export function data_productLine_queryStatus(payload: any) {
    return service({
        url: '/productLine/queryStatus',
        method: 'GET',
        params: payload
    })
}
//根据关键字查询
export function data_productLine_queryKey(key: any) {
    return service({
        url: '/productLine/queryKey',
        method: 'GET',
        params: {
            key
        }
    })
}
//删除数据
export function data_productLine_delete(productLineId: any) {
    return service({
        url: `/productLine/delete/${productLineId}`,
        method: 'DELETE',
        data: {
            productLineId
        }
    })
}
//根据id进行查询
export function data_productLine_querySingle(payload = {}) {
    return service({
        url: '/productLine/querySingle',
        method: 'GET',
        params: payload
    })
}

//属性管理
//新增属性
export function form_property_add(payload = {}) {
    return service({
        url: '/property/add',
        method: 'POST',
        data: payload
    })
}
//分页查询
export function form_property_queryAll(payload = {}) {
    return service({
        url: '/property/queryAll',
        method: 'GET',
        params: payload
    })
}
//编辑内容
export function form_property_update(payload = {}) {
    return service({
        url: '/property/update',
        method: 'PUT',
        data: payload
    })
}
//修改状态
export function form_property_updateStatus(propertyId: any, propertyStatus: any) {
    return service({
        url: `/property/updateStatus/${propertyId}/${propertyStatus}`,
        method: 'PUT',
    })
}
//根据状态进行查询
export function form_property_queryStatus(payload: any) {
    return service({
        url: '/property/queryStatus',
        method: 'GET',
        params: payload
    })
}
//根据关键字查询
export function form_property_queryKey(key: any) {
    return service({
        url: '/property/queryKey',
        method: 'GET',
        params: {
            key
        }
    })
}
//删除数据
export function form_property_delete(propertyId: any) {
    return service({
        url: `/property/delete/${propertyId}`,
        method: 'DELETE',
    })
}
//根据id进行查询
export function form_property_querySingle(propertyId:any) {
    return service({
        url: '/property/querySingle',
        method: 'GET',
        params: {
            propertyId
        }
    })
}

//菜单管理
//新增属性
export function form_menu_add(payload = {}) {
    return service({
        url: '/menu/add',
        method: 'POST',
        data: payload
    })
}
//分页查询
export function form_menu_queryAll(payload = {}) {
    return service({
        url: '/menu/queryAll',
        method: 'GET',
        params: payload
    })
}
//编辑内容
export function form_menu_update(payload = {}) {
    return service({
        url: '/menu/update',
        method: 'PUT',
        data: payload
    })
}
//修改状态
export function form_menu_updateStatus(menuId: any, menuStatus: any) {
    return service({
        url: `/menu/updateStatus/${menuId}/${menuStatus}`,
        method: 'PUT',
    })
}
//根据关键字查询
export function form_menu_queryKey(key: any) {
    return service({
        url: '/menu/queryKey',
        method: 'GET',
        params: {
            key
        }
    })
}
//删除数据
export function form_menu_delete(menuId: any) {
    return service({
        url: `/menu/delete/${menuId}`,
        method: 'DELETE',
    })
}